package com.gang.blog.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gang.blog.dao.CategoryMapper;
import com.gang.blog.domain.Category;
import com.gang.blog.service.CategoryService;


@Service("/categoryServiceImpl")
public class CategoryServiceImpl implements CategoryService {
	@Resource
	private CategoryMapper categoryMapper;
	
	public void setCategoryMapper(CategoryMapper categoryMapper) {
		this.categoryMapper = categoryMapper;
	}
	//得到所有的类型
	public List<Category> getAllCategory() {
		List<Category> list = this.categoryMapper.selectAll();
		return list;
	}
	//根据id得到类型
	public Category getCategoryById(Integer categoryId) {
		// TODO Auto-generated method stub
		return this.categoryMapper.selectByPrimaryKey(categoryId);
	}

}
